package com.xjlsoft.weather.enums;

/**
 * 结果码枚举
 *
 */
public enum ResultCodeEnum {

	SUCCESS("200", "操作成功"),
	FAILURE("300","操作失败"),
	ERROR_401("401","无权访问"),
    ERROR_400("400", "校验异常"),
    ERROR_3001("3001", "令牌失效,请重新登录"),
    ERROR_403("403", "没有权限"),
    ERROR_404("404", "404异常"),
    ERROR_500("500", "其他所有异常"),
    ERROR_CAPTCHA("501", "验证码错误"),
    NO_USER("1001","用户不存在"),
    USER_STATUS_ERROR("1002","用户已锁定,无法登录"),
    PASSWORD_ERROT("1003","密码错误"),
    ERROR_9005("9005","复制原文件异常!"),
    ERROR_9007("9007","目录不存在，无法删除"),
    ERROR_SERVER("-1", "服务器忙");





    private final String value;

    private final String message;

    ResultCodeEnum(String value, String message) {
        this.value = value;
        this.message = message;
    }

    public String getValue() {
        return value;
    }

    public String getMessage() {
        return message;
    }

    public static String valueof(String value) {
        for (ResultCodeEnum e : ResultCodeEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getMessage();
            }
        }
        return null;
    }
    }
